Skip to content

Avoid emitting position change event unnecessarily and emit inside the zone #28616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

crisbeto
Copy link
Member

Includes the following fixes:

fix(cdk/overlay): only emit positionChanges when position is different

Currently we emit the positionChanges event whenever a position is recalculcated which can be on each scroll event. These changes switch to doing so only if either the actual position or the scrolled state has changed.

fix(cdk/overlay): run positionChange event inside the zone

Fixes that the positionChange event of the CdkConnectedOverlay directive was running outside the zone.

Fixes #28568.

Currently we emit the `positionChanges` event whenever a position is recalculcated which can be on each scroll event. These changes switch to doing so only if either the actual position or the scrolled state has changed.
Fixes that the `positionChange` event of the `CdkConnectedOverlay` directive was running outside the zone.

Fixes angular#28568.
@crisbeto crisbeto added target: patch This PR is targeted for the next patch release merge: preserve commits When the PR is merged, a rebase and merge should be performed labels Feb 20, 2024
@crisbeto crisbeto requested a review from jelbourn as a code owner February 20, 2024 08:27
@crisbeto crisbeto self-assigned this Feb 21, 2024
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Feb 21, 2024
@crisbeto crisbeto merged commit b513b50 into angular:main Feb 21, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker merge: preserve commits When the PR is merged, a rebase and merge should be performed target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(CDK-Overlay): positionChange event runs outside of ngZone
2 participants